﻿@model IEnumerable<SmallBusinessKit.Models.Entities.Category>

@{
    var idx = 1;
    var cnt = Model.Count();
    foreach (var category in Model)
    {
        <p class="shimTop15">
            <img src="~/Content/Images/@category.ImageUrl" class="photo-border photo-float-left photo2"/>
            <h3>
                @Ajax.ActionLink(@category.Title, "GetChildItems", "Items", new {@id = category.Id}, new AjaxOptions {HttpMethod = "post", InsertionMode = InsertionMode.Replace, UpdateTargetId = "TargetDiv", OnFailure = "onFailure"})
            </h3>

            @category.Desc
        </p>

        <br/>
        @Ajax.ActionLink("Read More...", "GetChildItems", "Items", new {@id = category.Id}, new AjaxOptions {HttpMethod = "post", InsertionMode = InsertionMode.Replace, UpdateTargetId = "TargetDiv", OnFailure = "onFailure"})

        if (idx != cnt)
        {
            <hr/>
        }
        idx++;
    }
}